package ua.maxicash.validation;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ua.maxicash.service.GeoService;
import ua.maxicash.validation.annotations.City;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

@Component
public class CityValidator implements ConstraintValidator<City, ua.maxicash.vo.City> {

    @Autowired
    GeoService geoService;

    @Override
    public void initialize(City constraintAnnotation) {
    }

    @Override
    public boolean isValid(ua.maxicash.vo.City city, ConstraintValidatorContext context) {

        return city != null;

    }

}
